<div id="content">
  <div class="row s_page_title">
    <sa-big-breadcrumbs
      [items]="['日志信息管理', '删除日志管理']"
      icon="fa fa-tag"
      class="col-xs-12 col-sm-7 col-md-7 col-lg-4"
    ></sa-big-breadcrumbs>
  </div>
  <sa-widgets-grid>
    <div class="s_table">
      <div sa-widget [editbutton]="false" color="darken" class="clearfix">
        <header>
          <span class="widget-icon"><i class="fa fa-table"></i></span>
          <h2>删除日志管理</h2>
        </header>
        <div>
          <div class="widget-body no-padding">
            <div class="page-header clearfix s_table_opreation">
              <div class="left page-header-btn" style="width: calc(100% - 220px)">
                <sa-company-tree-car
                  companyTreeId="companyTree"
                  wrapId="content"
                  [isShowCarSort]="false"
                  [isShowCarNum]="true"
                  (companySelected)="companySelected($event)"
                ></sa-company-tree-car>
                <div class="top_module">
                  <span class="module_text">时间类型</span>
                  <select name="" id="" class="module_inp" [(ngModel)]="dateType" (change)="changeDateType()">
                    <option value="1">缴费时间</option>
                    <option value="2">开始时间</option>
                    <option value="3">结束时间</option>
                  </select>
                </div>
                <div class="top_module">
                  <span class="module_text">数据来源</span>
                  <select name="" id="" class="module_inp" [(ngModel)]="dataSourceType">
                    <option value="">全部</option>
                    <option value="1">批量导入</option>
                    <option value="2">随你运小程序</option>
                    <option value="3">平台新增</option>
                    <option value="4">API接口对接</option>
                  </select>
                </div>
                <div class="top_module">
                  <span class="module_text">费用类型</span>
                  <select name="" id="" class="module_inp" [(ngModel)]="billType">
                    <option value="">全部</option>
                    <option value="1">服务费</option>
                    <option value="2">对接费</option>
                  </select>
                </div>
                <div class="selectDate top_module">
                  <table-select-date
                    [notInit]="false"
                    [specifyId]="specifyId"
                    (outerTime)="getSelectTableTime($event)"
                    [specifyTime]="specifyTime"
                  ></table-select-date>
                </div>
                <button type="button" class="btn btn-primary" (click)="tableSearch()">查询</button>
              </div>
              <div class="right top-search">
                <input
                  type="text"
                  [(ngModel)]="searchKey"
                  (change)="tableSearch()"
                  class="search-input"
                  placeholder="车牌号、公司名称、设备ID"
                />
                <span class="top-search-box">
                  <button class="top-search-btn" type="button" (click)="tableSearch()">
                    <i class="fa fa-search"></i>
                  </button>
                </span>
              </div>
            </div>
            <div class="table_scroll">
              <table
                class="
                  display
                  dataTables
                  responsive
                  table table-striped table-bordered table-hover
                  dataTable
                  s_h5_table
                "
              >
                <thead>
                  <tr>
                    <th>车牌号</th>
                    <th>设备ID</th>
                    <th>对接公司</th>
                    <th>费用类型</th>
                    <th>缴费时间</th>
                    <th>开始时间</th>
                    <th>结束时间</th>
                    <th>对接时长</th>
                    <th>数据来源</th>
                    <th>创建时间</th>
                    <th>创建人</th>
                    <th>删除日期</th>
                    <th>删除人</th>
                  </tr>
                </thead>
                <tbody>
                  <tr *ngFor="let row of tableData" [ngClass]="{ selected: activeSelected === row.id }">
                    <td>{{ row.carNumber }}</td>
                    <td>{{ row.deviceId }}</td>
                    <td>{{ row.companyName }}</td>
                    <td>
                      <span *ngIf="row.billType == 1">服务费</span>
                      <span *ngIf="row.billType == 2">对接费</span>
                    </td>
                    <td>{{ row.createDate }}</td>
                    <td>{{ row.startTime }}</td>
                    <td>{{ row.endTime }}</td>
                    <td>{{ row.renewalCycle }}个月</td>
                    <td>
                      <span *ngIf="row.dataSource == 1 || row.dataSource == '' || row.dataSource == null">
                        批量导入
                      </span>
                      <span *ngIf="row.dataSource == 2">随你运小程序</span>
                      <span *ngIf="row.dataSource == 3">平台新增</span>
                      <span *ngIf="row.dataSource == 4">API接口对接</span>
                    </td>
                    <td>{{ row.createTime }}</td>
                    <td>{{ row.createName }}</td>
                    <!-- 这里也根据权限 -->
                    <td>{{ row.delTime }}</td>
                    <td>{{ row.delUser }}</td>
                  </tr>
                </tbody>
              </table>
            </div>
            <div class="table-fix clearfix">
              <paginator
                [totalRecords]="totalCounts"
                [rows]="pageSize"
                [currentPage]="curPage - 1"
                (onPageChange)="paginate($event)"
              ></paginator>
              <button type="button" class="btn default refresh_btn" (click)="refresh()">
                <i class="fa fa-refresh"></i>
              </button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </sa-widgets-grid>
</div>
